class Storage {
  static saveStorage(key, val) {
    localStorage.setItem(key, JSON.stringify(val));
  }
  static getStorage(key) {
    try {
      return JSON.parse(localStorage.getItem(key)) || [];
    } catch (error) {
      console.error(error);
    }
  }
  static clearStorage(key) {
    try {
      key && localStorage.removeItem(key);
      !key && localStorage.clear();
    } catch (error) {
      console.error(error);
    }
  }
}
export default Storage;
